package com.ctgu.chatapp.viewModel

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MutableLiveData
import com.ctgu.chatapp.model.Database.DataBaseManager
import com.ctgu.chatapp.showPojo.ItemFriend
import kotlin.properties.Delegates

class ChatViewModel(application: Application) : AndroidViewModel(application) {

    lateinit var friend: ItemFriend

    var chatID by Delegates.notNull<Long>()

    lateinit var profile: String

    val inputText: MutableLiveData<String> = MutableLiveData()

    private val dataBase = DataBaseManager.getInstance(application)

    val recordList by lazy {
        dataBase.getMsgDao().getChatRecord(chatID, friend.chatID)
    }

}